package org.ii.domain.user;

import javax.validation.Valid;
import javax.validation.constraints.Pattern;

import lombok.Getter;
import lombok.Setter;

import org.hibernate.annotations.Type;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;
import org.ii.domain.common.Entity;
import org.ii.domain.company.Company;

@javax.persistence.Entity
public class User extends AbstractUser implements Entity {
	
	
	@Pattern(regexp="[a-zA-Z\\pL\\s\\-]{2,40}", message="Kun bokstaver, lovlig lengde er 2-40 tegn!")
	@NotBlank(message="Krever utfylling!")
	@Getter @Setter	
	private String name;
	
	@Email(message="ikke en gyldig e-post adresse!")
	@Getter @Setter
	private String email;
	
	@Valid
	@Getter @Setter
	private Boolean subscribeNewsletter;

	@Valid
	@Getter @Setter
	private Boolean okToPublishNameOnWeb;
	
	@Valid
	@Length(max=1000, message="Dersom du har så mye på hjertet, skriv oss gjerne heller en e-post. (maks 1000 tegn her!)")
	@Getter @Setter
	@Type(type="text")
	private String comment;
	
	
	
	
}
